%{
#include <stdio.h>
#include <string.h>

#include "grammer.h"

%}

%%
#.*	/*ignore*/;
\/\/.*	/*ignore*/;
remote	return KEYWORD_REMOTE;
local	return KEYWORD_LOCAL;
ip		return KEYWORD_IP;
port	return KEYWORD_PORT;
ports	return KEYWORD_PORTS;
[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ 		yylval.string = strdup(yytext); return IP_ADDR;
[0-9]+\ ?\,\ ?([0-9]+\ ?\,?\ ?)+	yylval.string = strdup(yytext); return PORTS_LIST;
[0-9]+								yylval.number = atoi(yytext) ; return NUMBER;
[a-zA-Z][a-zA-Z]* 					yylval.string = strdup(yytext); return WORD;
\n		/*ignore*/;
[ \t]+	/*ignore*/;
.		return (int) yytext[0];
%%
